#ifndef __ASTR_H__
#define __ASTR_H__

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>
#include <stdarg.h>
#include <stdlib.h>

    typedef struct astr_st
    {
        size_t cap;
        size_t len;
        char *data;
    } astr_t;

    extern astr_t *astr_init(const char *str);
    extern int astr_add(astr_t *ptr, const char c);
    extern int astr_append(astr_t *ptr, const char *str);
    extern int astr_reset(astr_t *ptr);
    extern void astr_deinit(astr_t **pp);

#ifdef __cplusplus
}
#endif

#endif